package com.jingxi.common.pojo;

import java.util.Random;

public class IDUtils {
    public static String genImageName(){
        long millis=System.currentTimeMillis();
        Random random=new Random();
        int ends=random.nextInt(999);
        String str=millis+String.format("%03d",ends);
        return str;
    }
    public static long getItemId(){
        //取当前时间长整形值包含毫秒
        long millis=System.currentTimeMillis();
        Random random=new Random();
        //加上两个随机数
        int end2=random.nextInt(99);
        //如果不足两位前面补0
        String str=millis+millis+String.format("%02d",end2);
        long id=new Long(str);
        return id;
    }

}
